package com.weibo4j.api.req.favourite;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import com.weibo4j.api.WeiboRequest;
import com.weibo4j.api.response.favourite.FavouriteGetResponse;
import com.weibo4j.api.util.RequestType;

public class FavouriteTagUpdateRequest extends WeiboRequest<FavouriteGetResponse>{

    private Long id;
    
    private String tags;
    
    public String getTags() {
        if (tags != null) {
            try {
                return URLEncoder.encode(tags, "utf-8");
            } catch (UnsupportedEncodingException e) {
            }
        }
        return tags;
    }

    public void setTags(String tags) {
        this.tags = tags;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public RequestType requestType() {
        return RequestType.POST;
    }

    @Override
    public String baseUrl() {
        return "https://api.weibo.com/2/favorites/tags/update.json";
    }

    @Override
    protected Class<FavouriteGetResponse> responseType() {
        return FavouriteGetResponse.class;
    }

}
